package com.easy.neo4j.repository;

import com.easy.neo4j.entry.bus.SiteReader;
import org.springframework.data.neo4j.repository.Neo4jRepository;
import org.springframework.data.neo4j.repository.query.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author: CoolPro
 * @Desc:
 * @create: 2024-03-19 16:07
 **/
@Repository
public interface BusLineRepository extends Neo4jRepository<SiteReader, Long> {

    @Query("MATCH (bus:BusSite)-[line:BusLine]->(:BusSite) " +
            "WHERE line.lineName = $line " +
            "RETURN bus ")
    List<SiteReader> findLine(@Param("line") String line);
}
